package antistatic.spinnerwheel.adapters;

import android.content.Context;

public class ArrayWheelAdapter<T> extends AbstractWheelTextAdapter {
	private T[] items;

	public ArrayWheelAdapter(Context context, T[] items) {
		super(context);
		this.items = items;
	}

	@Override
	public CharSequence getItemText(int index) {
		if (index < 0 || index >= this.items.length) {
			return null;
		}
		T item = this.items[index];
		return item instanceof CharSequence ? (item) + ":00" : item.toString() + ":00";
	}

	public int getItemsCount() {
		return this.items.length;
	}
}